#pragma once

#include <cstdint>
#include <map>
#include <vector>


namespace vortex
{
	enum class EventType
	{
		EVENT_KEY_PRESSED,
		EVENT_KEY_RELEASED,
		EVENT_BUTTON_PRESSED,
		EVENT_BUTTON_RELEASED,
		EVENT_MOUSE_CLICK,
		EVENT_MOUSE_MOVE,
		EVENT_MOUSE_SCROLL,

		MAX_NUM_EVENT,
	};

	struct EventContext
	{
		union 
		{
			uint8_t u8[8];
			uint32_t u32[2];
			float f32[2];
			double f64;
		} data;
	};

	struct Event
	{
		bool handled;
		EventType type;
		EventContext context;
	};

	typedef bool (*PFN_on_event)(EventType type, void* sender, void* listener, void* context);

	void register_event(EventType type, void* listener, PFN_on_event callback);
	void fire_event(Event event, void* sender);

}
